#include<stdio.h>
int main()
{
    int a = 0;
    int b = 0;
    scanf("%d %d",&a,&b);
    int i = 0;
    int count = 1;
    int sum = 0;
    for(i=a;i<=b;i++)
    {
        printf("%5d",i);
        if(count==5||i==b)
        {
            printf("\n");
            count=0;
        }
        sum = sum+i;
        count++;
    }
    printf("Sum = %d",sum);
    return 0;
}